In this demo, you will learn about input
components in the material library, On the official websites of material. Check that there are several predefined
input components under the category of the input with various names and
various purposes of use. For example, the button component
is used for action purposes. The checkbox component is
used as a radio button. The text field component is used
to take input from the user. Text field has various props such
as outlined, filled and standard, text field supports different
form attributes such as required, disabled or the type of the props. Similarly, text field also accepts
the helper text props where you can pass important texts or messages for
the user based on the input. Moving to the code,
you have imported button, text field and checkbox components for a material. You are using the components
in the application. Text field primarily uses
props such as required name, label, for with and
value is used to pass the initial or user entered value and
accept the method of on change. The method executes when on change
takes the user entered value from e.target.value. Upon entering some value in the input
text field accepts the props on change where checkbox changes the current
state from checked to unchecked. And vice versa upon a user click action,
With button passed the final submission and file rendering
after taking input from the user. Now check how to use the input component
in the react application you have created a form page in the pages folder that
imports the input component and uses it, wrap the input based component with
additional features into the pages. Next in the app.js,
you need to import the form.jsx, save the file and
execute the code in the output. The initial value that you provided
to text field is displayed. Other text field components that you
passed into the input component are also available. Checkbox changes its state when
the check box icon is clicked, The register button can be clicked for further processing with
the submitted user inputs. In this way, you can create some set of input
components to take input from the user. Thank you.